{% extends "WileadAdminBundle::layout.html.twig" %}

{% block container -%}
<form method="get" action="">
    {{ form_rest(filter) }}
    <input class="btn btn-info" type="submit" name="submit-filter" value="搜索" />
    <a class="btn" href="{{ path('messagelog') }}">清空条件</a>
</form>
<h1>短信发送列表</h1>
<table class="table">
    <thead>
        <tr>
            <th>Id</th>
            <th>号码</th>
            <th>内容</th>
            <th>发送时间</th>
        </tr>
    </thead>
    <tbody>
        {% for entity in entities %}
            <tr>
                <td>{{ entity.id }}</td>
                <td>{{ entity.mobile }}</td>
                <td>{{ entity.content }}</td>
                <td>{% if entity.created %}{{ entity.created|date('Y-m-d H:i:s') }}{% endif %}</td>
            </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}

{% block javascript %}
{{ parent() }}
<script>
$(document).ready(function(){
    $('#wilead_smsbundle_messagelog_filter_created_left_date, #wilead_smsbundle_messagelog_filter_created_right_date').datepicker({
        format: 'yyyy-mm-dd',
        language: 'zh-CN'
    });
});
</script>
{% endblock javascript %}